import { onBeforeMount, onMounted } from "vue"

export const useHtmlFontSize = () => {
  const resizeFn = () => {
    document.documentElement.style.fontSize =
      document.body.clientWidth / 10 + "px"
  }

  onBeforeMount(() => {
    resizeFn()
    // document.documentElement.classList += "dark"
  })
  onMounted(() => {
    window.addEventListener("resize", () => {
      resizeFn()
    })
  })
}
